<?php
/**
 * System.php
 * Niushop商城系统 - 团队十年电商经验汇集巨献!
 * =========================================================
 * Copy right 2015-2025 山西牛酷信息科技有限公司, 保留所有权利。
 * ----------------------------------------------
 * 官方网址: http://www.niushop.com.cn
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用。
 * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
 * =========================================================
 * @author : niuteam
 * @date : 2015.1.17
 * @version : v1.0.0.0
 */
namespace app\platform\controller;

use data\service\Album as Album;
use data\service\EnterpriseRegistration;
use data\service\Goods as Goods;
use data\service\GoodsBrand as GoodsBrand;
use data\service\GoodsCategory as GoodsCategory;
use data\service\Platform;

/**
 * 系统模块控制器
 *
 * @author Administrator
 *
 */
class EerpriseRegistration extends BaseController
{

    public function __construct()
    {
        parent::__construct();
    }



    public function toExamineSettledIn()
    {

    }

    public function settledInList()
    {
        $page_index = request()->get('pageIndex', 1);
        $name = request()->get('name', '');
        $status = request()->get('status', '');
        $id = request()->get('id', '');
        $goodservice = new EnterpriseRegistration();
        $condition = '';
        if ($status != "") {
            $condition["status"] = $status;
        }

        if (!empty($name)) {
            $condition["name"] = array(
                "like",
                "%" . $name . "%"
            );
        }
        if ($id != '') {
            $condition["id"] = $id;
        }
        $result = $goodservice->getGoodsList($page_index, 20, $condition, 'ng.create_time desc');
        $platform = new Platform();
        if (!empty($result['data'])) {
            foreach ($result['data'] as $k => $v) {
                $result['data'][$k]['is_platform_new'] = $platform->getGoodsIsnew($v['goods_id']);
                $result['data'][$k]['is_platform_best'] = $platform->getGoodsIsBest($v['goods_id']);
                $result['data'][$k]['is_platform_hot'] = $platform->getGoodsIshot($v['goods_id']);
            }
        }

    }


}